package net.hanjava.test;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JPanel;

public class GrayRectExample extends JPanel {
	public GrayRectExample() {
		setBackground( Color.BLUE );
		setPreferredSize(new Dimension(300, 300));
	}

	protected void paintComponent(Graphics g) {
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		super.paintComponent(g);
		g.setColor( Color.YELLOW );
		String ver = System.getProperty("java.version");
		g.drawString(ver, 100, 100);
	}

	public static void main(String[] args) {
		JPanel panel = new GrayRectExample();
		Util.test(panel);
	}
}